<template>
    <div class="">

    </div>
</template>
<script>
import { mapGetters } from 'vuex'
import reles from '@/router/roles/role.js'
export default {
    name:"Router",
    data() {
        return {
            id:'',
            name:''
        }
    },
    //实例创建
    created(){
        // console.log(reles);
        //判断是否总部登录
        this.isBossLog();
    },
    //计算属性
    computed:{
        ...mapGetters(['userInfo','storeId'])
    },
    //方法
    methods: {
        //判断是否总部登录
        isBossLog(){
            var _this = this;
            
            //总部账号
            if(_this.storeId<1){
                //console.log("总部账号登录");
                //总部首页默认路径
                const path = reles.defaultBossPath; //默认路径
                //console.log(""+path+"");
                _this.$router.push(path);
            }
            //门店账号
            else{
                // console.log("门店账号登录");
                //门店默认路径
                const path = reles.defaultStaffPath; //默认路径
                console.log(path)
                _this.$router.push(path);
            }
            
        },
        role() {
            return this.name === 'admin' ? '超级管理员' : '普通用户';
        }
    }
}
</script>
<style lang="stylus" scoped>

</style>


